package com.portal.common.security.annotation;

import org.springframework.context.annotation.EnableAspectJAutoProxy;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;


@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@EnableAspectJAutoProxy
public @interface ApiLimit {
    // Redis + Lua 限流实现
    // @Limit(key = "login", period = 60, frequency = 20, name = "登录接口", prefix = "limit")
    /**
     * 限制时间 (单位：秒)
     */
    int period() default 10;

    /**
     * 接口访问频率
     */
    int frequency() default 3;

}

